# coding:utf8
"""
author:shadu@foxmail.com
"""
import re

def is_ipaddr(ipaddr):
    return re.match(r'^\d+\.\d+\.\d+\.\d+$', ipaddr) is not None


def is_port(port):
    return re.match(r'^\d+$', port) is not None


def is_proxy_ip_and_port(proxy):
    return re.match(r'^\d+\.\d+\.\d+\.\d+:\d+$', proxy) is not None


if __name__ == '__main__':
    print is_proxy_ip_and_port('127.0.0.1:8080')
    print is_proxy_ip_and_port('127.0.0.a:8080')